BEGIN {commentcount = 0}
{starcomment = index($0, "/*");
endcomment =  index($0, "*/");
# neither starting a comment nor in one
if (starcomment == 0 && commentcount == 0 && endcomment == 0)
	{
	print $0;
	next;
	}
if( starcomment > 0 || endcomment > 0)
    {
    printed = 0
    if(starcomment > 0)
	{
	if(commentcount++ == 0) #first comment
	    {
	    printf("%s",substr($0,1,starcomment-1));
    	    printed = 1
	    }
	}
    if(endcomment > 0)
	{
	commentcount = 0 # close closes nested ones as well!
	printf("%s",substr($0,endcomment+2));
        printed = 1
	}
    if(printed == 1)
	{
	printf("\n");
	printed = 0;
	}
    }
next;
}
